package GUI.SalesEmployee;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;

import GUI.ManagerEmployee.AddSaleTemplatePnl;
import GUI.ManagerEmployee.DefaultPanel;
import GUI.ManagerEmployee.GetSaleOperationPnl;
import GUI.ManagerEmployee.ManagerEmployeeGUI;
import GUI.ManagerEmployee.NewSalePnl;
import GUI.ManagerEmployee.ReportsPanel;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class SalesEmployeeGUI extends JFrame {

	SalesEmployeeGUI frame ;
	JPanel centerPanel;
	private JPanel contentPane;
	public ContactClientPnl contactClientPnl;
	public SetOrderPnl setOrderPnl;
	public UpdateClientPermissionPnl updateClientPermissionPnl;
	public DefaultPanel defaultPanel;
	
	public SalesEmployeeGUI() {
		centerPanel = new JPanel();
		setOrderPnl = new SetOrderPnl();
		updateClientPermissionPnl = new UpdateClientPermissionPnl();
		defaultPanel = new DefaultPanel();
		contactClientPnl = new ContactClientPnl();
		

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 816, 527);
		contentPane = new JPanel();
		
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
  // ------------------  Set Order ----------------	
		
		JButton btnsetOrder = new JButton("Set Order ");
		btnsetOrder.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				contentPane.remove(centerPanel);
				centerPanel = setOrderPnl;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				
                repaint();
                	
			}
		});
	
		btnsetOrder.setBounds(10, 125, 151, 36);
		contentPane.add(btnsetOrder);

		// ------------------  Update Client Permission  ----------------
		
		JButton btnUpdatePermission = new JButton("Update Client Permission");
		btnUpdatePermission.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				 
				contentPane.remove(centerPanel);
				centerPanel = updateClientPermissionPnl;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				
                repaint();
				
			}
		});
		btnUpdatePermission.setBounds(10, 78, 151, 36);
		contentPane.add(btnUpdatePermission);
		
		
		// ------------------  Home ----------------	
		
		JButton btnHome = new JButton("Home");
		btnHome.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				 
				contentPane.remove(centerPanel);
				centerPanel = defaultPanel;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				repaint();
				
			}
		});
		btnHome.setBounds(10, 28, 151, 36);
		contentPane.add(btnHome);
		
		// ------------------  Contact Client ------------------
				JButton btncontactClient = new JButton("Contact Client");
				btncontactClient.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {			
						 
						contentPane.remove(centerPanel);
						centerPanel = contactClientPnl ;
						centerPanel .setBounds(171, 11, 619, 451);
						contentPane.add(centerPanel );
						
		                repaint();
					}
				});
				
				btncontactClient.setBounds(10, 172, 151, 36);
				contentPane.add(btncontactClient);
		
	//------------------------------------------------------------------	
		
		centerPanel.setBounds(171, 11, 619, 451);
		contentPane.add(centerPanel);
		
	
	// ------------------  Exit ------------------		
		JButton btnExit = new JButton("exit");
		btnExit.setBounds(10, 383, 151, 36);
		contentPane.add(btnExit);
		
		setVisible(true);
	}

}
